<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>SSHE</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--顺序很重要！  -->
<script type="text/javascript" src="jslib/jquery-easyui-1.3.1/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="jslib/jquery-easyui-1.3.1/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jslib/jquery-easyui-1.3.1/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="jslib/jquery-easyui-1.3.1/themes/default/easyui.css" type="text/css" />
<link rel="stylesheet" href="jslib/jquery-easyui-1.3.1/themes/icon.css" type="text/css" />
<script type="text/javascript" src="jslib/syUtils.js"></script>

<script type="text/javascript">
	$(function(){
		
	});

	function regUser() {
		$('#index_regForm').form('submit',{
		    url:'${pageContext.request.contextPath}/userAction!reg.action',
		    success:function(d){
		    	console.info(d);
		    	// var obj = eval("("+d+")");
		    	var obj = jQuery.parseJSON(d);
		    	console.info(obj);
		    	if(obj.success) {
		    		$("#index_regDialog").dialog("close");
		    	}
		    	$.messager.show({
		    		title:'提示',
					msg:obj.msg
		    	});
		    }
	   	});
	}
</script>
</head>

<body class="easyui-layout">
	<div data-options="region:'north'" style="height:60px;"></div>
	<div data-options="region:'south'" style="height:20px;"></div>
	<div data-options="region:'west',split:true" style="width:200px;">
		<div class="easyui-panel" data-options="title:'ssss',border:false,fit:true"></div>
	</div>
	<div data-options="region:'east',title:'east title'" style="width:200px;"></div>
	<div data-options="region:'center',title:'center title'"></div>

	<div class="easyui-dialog" data-options="title:'登录',modal:true,closable:false,
			buttons:[{
				text:'注册',
				iconCls:'icon-edit',
				handler:function(){
					<!-- $('#index_regForm').form('load',{name:'',pwd:'',rePwd:''}); -->
					$('#index_regForm input').val('');
					$('#index_regDialog').dialog('open');
				}
			},{
				text:'登录',
				iconCls:'icon-help',
				handler:function(){alert('help')}
			}]">
		<table>
			<tr>
				<th>登录名</th>
				<td><input /></td>
			</tr>
			<tr>
				<th>密码</th>
				<td><input /></td>
			</tr>
		</table>
	</div>

	<div id="index_regDialog" style="width:250px;" class="easyui-dialog" data-options="title:'注册',closed:true,modal:true,
			buttons:[{
				text:'注册',
				iconCls:'icon-edit',
				handler:function(){
					regUser();
				}
			}]">
			
		<form id="index_regForm" method="post">
			<table>
				<tr>
					<th>登录名</th>
					<td><input name="name" class="easyui-validatebox" data-options="required:true,missingMessage:'登录名称必填'"/></td>
				</tr>
				<tr>
					<th>密码</th>
					<td><input name="pwd" type="password" class="easyui-validatebox" data-options="required:true" /></td>
				</tr>
				<tr>
					<th>重复密码</th>
					<td><input name="rePwd" type="password" class="easyui-validatebox" data-options="required:true,validType:'eqPwd[\'#index_regForm input[name=pwd]\']'"/></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
